#include "VulkanMesh.h"



void CVulkanMesh::RecordDrawCommands(vk::CommandBuffer InCmdBuffer,int32_t InstanceCount, int32_t FirstInstance)
{
    vk::Buffer VulkanVertexBuffer = VertexBuffer->GetBuffer();
    vk::DeviceSize VertexBufferOffset = VertexBuffer->GetOffset();
    InCmdBuffer.bindVertexBuffers(0,1,&VulkanVertexBuffer,&VertexBufferOffset);
    if(IndexCount)
    {
        InCmdBuffer.bindIndexBuffer( IndexBuffer->GetBuffer(), IndexBuffer->GetOffset(), vk::IndexType::eUint32);
        InCmdBuffer.drawIndexed(IndexCount, InstanceCount, 0, 0, FirstInstance);
    }
    else
    {
        InCmdBuffer.draw(VertexCount, InstanceCount, 0, FirstInstance);
    }
}